<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <script src="../js/jquery-3.6.0.min.js"></script>
    <style>
        .title {
            line-height: 40px;
            height: 40px;
            text-indent: 10px;
        }

        .list li {
            text-indent: 10px;
            line-height: 40px;
            height: 40px;
            border: 1px solid #333;
        }
    </style>
</head>

<body>
    <div id="wrap">
        <h3 class="title">jquery获取元素</h3>
        <ul class="list">
            <li class="first"><span>01</span></li>
            <li>02</li>
            <li class="mid">03</li>
            <li>04</li>
            <li>05</li>
            <li class="last">06</li>
        </ul>
        <input type="text" class="search">
    </div>
</body>
<script>
    // 属性
    // attr(key,value)    获取和设置属性节点(getAttribute setAttribute)
    // removeAttr(key)    根据键名删除属性

    // attr(key)        根据键名取值 => getAttribute
    // attr(key,value)  对应键名赋值 => setAttribute

    // $(".first").attr("id", "demo").attr("asd", "asd").attr("data-index", 0);
    // console.log($(".first").attr("id"));
    // console.log($(".first").attr("class"));
    // console.log($(".first").attr("asd"));
    // console.log($(".first").attr("data-index"));


    // prop(key,value) 获取和设置元素节点的属性(property)
    // console.log($(".first").prop("id"));  // ele.id
    // console.log($(".first").prop("className")); // ele.className
    // console.log($(".first").prop("classList")); // ele.classList
    // console.log($(".first").prop("clientWidth")); // ele.classList
    // console.log($(".first").prop("clientHeight")); // ele.classList












</script>

</html>